//
//  MDHttpService.h
//  jewelryMD
//
//  Created by 洪闽程 on 2018/7/7.
//  Copyright © 2018年 洪闽程. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MError.h"

//成功的回调
typedef void(^successBlock) (NSDictionary *dic);
//失败的回调
typedef void(^failBlock) (MError *error);

/** 上传、下载返回信息*/
typedef void(^completionHandle) (id data, NSError *error);

@interface MDHttpService : NSObject

+(MDHttpService *)shareHttpService;

/** get请求*/
-(void)getUrlStr:(NSString *)urlstr andparam:(NSDictionary *)param andsuccess:(successBlock)successblock andfailed:(failBlock)failblock;

/** post请求*/
-(void)postUrlStr:(NSString *)urlstr andparam:(NSDictionary *)param andsuccess:(successBlock)successblock andfailed:(failBlock)failblock;

/** 下载文件*/
- (NSURLSessionDownloadTask *)downRequesURLPath:(NSString *)pathStr locFilePath:(NSString*)locFilePath andCompletionHandle:(completionHandle)completionHandle;


@end
